<%@ page import="jakarta.servlet.ServletContext" %>
<%@ page import="jakarta.servlet.http.HttpServletRequest" %>
<%@ page import="java.awt.print.Book" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title></title>
  </head>
  <body>
<span>
  张三，您购买的图书有：
</span><br>
<%
  String shu= request.getParameter("tushu");
  List<String> list = (List) session.getAttribute("list");
  if(list==null){
    list = new ArrayList<String>();
    session.setAttribute("list", list);
  }
  if (request.getParameter("tushu")!=null){
    list.add(shu);
  }
  for (String shu1 :list) {
    out.println(shu1+"<br/>");
  }
  %>

  </body>
</html>
